package com.example.vehicleservice.bean1;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class TripMetrics {
    private String   vin;                // 车辆唯一标识
    private Long    startTime;           // 行程开始时间(毫秒)
    private Long    endTime;             // 行程结束时间(毫秒)
    private Double  distance;         // 行驶里程(km)
    private Long    duration;          // 行驶时长(毫秒)
    private Double avgSpeed;       // 平均速度(km/h)
    private Double  maxSpeed;       // 最高速度(km/h)
    private Boolean speeding;     // 是否超速

    @Override
    public String toString() {
        return String.format(
                "TripMetrics{vin=%s, startTime=%d, endTime=%d, distance=%.2fkm, duration=%dms, avgSpeed=%.2fkm/h, maxSpeed=%.2fkm/h, speeding=%s}",
                vin, startTime, endTime, distance, duration, avgSpeed, maxSpeed, speeding
        );
    }
}
